Image recording apparatus and method, image reproducing apparatus and method, and recording medium on which image processing program is recorded

ABSTRACT

The present invention is intended to record image data having a wide dynamic range is a file together with image data having a narrow dynamic range. First, an image recording apparatus separately gradation-converts image data to be recorded into primary data having a narrow dynamic range and secondary data having a wide dynamic range. Then, the image recording apparatus calculates data that determines correlation between the primary data and secondary data and employs the calculated data as tertiary data. The image recording apparatus records the primary data and the tertiary data in a file. On the other hand, an image reproducing apparatus reads out primary data and tertiary data that were recorded in the above manner and reproduces secondary data having a wide dynamic range based on the primary data and the tertiary data.

CROSS REFERENCE TO RELATED APPLICATION

The disclosure of the following priority application is hereinincorporated by reference: Japanese Patent Application No. 2000-009371,filed Jan. 18, 2000.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to an image recording apparatus and methodfor recording image data as well as to a recording medium on which animage processing program for realizing the above image recordingapparatus on a computer is recorded. The invention also relates to animage reproducing apparatus and method for reproducing a file generatedby the above image recording apparatus as well as to a recording mediumon which an image processing program for realizing the above imagereproducing apparatus on a computer is recorded.

2. Description of the Related Art

In image recording apparatuses, usually, 8-bit-gradation (24 bits totalin the case of 3-color data) image data are compressed and recorded inthe form of a general-purpose compressed image file. Capable of beingexpanded by a general-purpose image-browsing program, such ageneral-purpose compressed image file has an advantage that it can beprinted or displayed easily without using any dedicated software.

In recent years, there have been developed image recording apparatusessuch as a digital still camera that can record raw data (i.e., dataobtained by merely digitizing an output of an imaging device).

Raw data are image data that are faithful to an output of an imagingdevice and include fine gradation components (gradation signals).Therefore, raw data have an advantage that they are not easily impairedby complex data processing for designing, printing, and like purposesand their subtle gradation signals are not easily lost.

Incidentally, a general-purpose compressed image file of about 8-bitgradations as mentioned above has a relatively narrow gradationreproduction (tone reproduction) range and allows a high-luminance-sideportion of an object to be reproduced with a gradation reproductionrange of 140% white at most. Such a general-purpose compressed imagefile has a problem that high-luminance-side/low-luminance-side gradationcomponents cannot be reproduced affluently with sufficient performance.It is desired that a general-purpose compressed image file have agradation reproduction range of up to 200% white, and if possible, 400%white.

A general-purpose compressed image file is expressed with 8-bitgradations. This results in a problem that discontinuity of gradationsbecomes conspicuous when a file is subjected to image processing such asa contrast conversion.

On the other hand, raw data as mentioned above have a large number ofquantization bits and hence allow fine middle range signals to bereproduced affluently with sufficient performance. However, raw data aregiven gradation characteristics and a data format that are specific tohardware such as a digital still camera. In standard form,general-purpose external apparatuses such as a printer and a monitorcannot deal with such raw data. That is, raw data are associated with aproblem that it requires dedicated image processing and cannot beprinted or displayed easily by a general-purpose external apparatus.

Image data such as raw data having a large number of quantization bitsinclude fine middle range signals affluently. The degree of spatialredundancy of raw data is extremely lower than 8-bit-gradation imagedata. This results in a problem that conventional image compressionmethods that eliminate spatial redundancy cannot compress raw data intoa file of a small size.

SUMMARY OF THE INVENTION

In view of the above, an object of the invention is to provide an imagerecording apparatus and method capable of efficiently recording imagedata having a wide gradation reproduction range.

Another object of the invention is to provide a recording medium onwhich an image processing program for allowing a computer to function asthe above image recording apparatus is recorded.

Still another object of the invention is to provide an image reproducingapparatus and method for reproducing image data that were recorded bythe above image recording apparatus.

A further object of the invention is to provide a recording medium onwhich an image processing program for allowing a computer to function asthe above image reproducing apparatus is recorded.

The invention provides an image recording apparatus comprising a firstconverting unit for converting image data into primary data having anN-bit range according to a first gradation conversion (tone conversion)characteristic; a second converting unit for converting the image datainto secondary data having an M-bit range according to a secondgradation conversion characteristic that is lower in the degree of levelcompression (knee compression) than the first gradation conversioncharacteristic or causes no level compression, where M is greater thanN; a correlation calculating unit for calculating data that determinescorrelation between the primary data and the secondary data andemploying the calculated data as tertiary data; and a recording unit forrecording the primary data and the tertiary data in a file.

In the above configuration, first, primary data having an N-bit rangethat is high in the degree of level compression and secondary datahaving an M-bit range (M>N) that is low in the degree of levelcompression are generated from the same image data. The secondary datais image data having a wider gradation reproduction range and moregradations than the primary data.

Then, the correlation calculating unit calculates data that determinescorrelation between the two kinds of data and employs the calculateddata as tertiary data. Usually, the primary data and the secondary dataare very similar to each other in the manner of gradation variationbecause they have been generated from the same image data. Therefore, asa result of the correlation calculation operation, redundantsimilarities between the two kinds of data can be discriminated properlyand tertiary data that reliably includes meaningful variation components(e.g., gradation data in the secondary data that does not exist in theprimary data) can be obtained.

The recording unit records the thus-obtained primary data and tertiarydata. The amount of recording data can be reduced properly becauseredundant similarities between the two kinds of data can bediscriminated in advance in contrast to a case of recording the primarydata and the secondary data separately.

It is preferable that the recording unit be a unit for recording theprimary data by irreversibly compressing it, and that correlationcalculating unit expand the irreversibly compressed primary data,calculate data that determines correlation between expanded primary dataand the secondary data, and employ the calculated data as the tertiarydata. Because the primary data is compressed irreversibly, irreversiblyvariations occur in the primary data as it is compressed and expanded.In this case, since the reference (primary data) to be used forreproducing the secondary data deviates, the secondary data can nolonger be reproduced completely. In view of this, the correlationcalculating unit expands the primary data that has been compressed forrecording and thereby generates expanded primary data that is the sameas primary data to be obtained at the time of reproduction. Thecorrelation calculating unit generates tertiary data by using theexpanded primary data as a reference. Therefore, the reference to beused at the time of reproduction does not deviate and hence thesecondary data can be reproduced more precisely.

It is preferable that the recording unit record the primary data in an“image storage segment to be preferentially referred to”, which is inthe file. In this case, by using a general-purpose image browsingprogram or the like, the primary data can be read out and printed ordisplayed easily in the same manner as in the case of handling aconventional image file. In other words, compatibility with conventionalimage files can be maintained.

It is preferable that the recording unit record the tertiary data in anapplication segment (i.e., one or a plurality of data segments able tobe optionally added to an image file) which is in the file. By using anapplication segment, compatibility with conventional image files can bemaintained.

It is preferable that the first gradation conversion characteristic andthe second gradation conversion characteristic have the samecharacteristic curve in at least a part of the entire input signalrange. By partially equalizing the first and second gradation conversioncharacteristics, the similarity between the two gradation conversioncharacteristics can be increased. Therefore, in the process ofgenerating tertiary data by correlation calculating, the amount ofrecording data of the image file can be reduced more reliably.

It is preferable that the correlation calculating unit calculate datarelating to dissimilarity between the primary data and the secondarydata and employ the calculated data as the tertiary data. In this case,it is not necessary to perform complex correlation detectingcalculations and hence tertiary data can be generated at high speed. Theimage reproducing apparatus side is also given an advantage that thesecondary data can be reproduced at high speed by such simple processingas addition of the primary data and the tertiary data.

It is preferable that the recording unit compress the tertiary data bynonlinearly quantizing it and record the compressed tertiary data in thefile. Usually, tertiary data includes such data as high-luminance-sideor low-luminance-side gradation components. In general, the sensitivityof human vision is low to small level differences in such gradationcomponents. Therefore, nonlinearly quantizing the tertiary data makes itpossible to compress the tertiary data in such a range that thecompression is not visually discernible.

It is preferable that the recording unit compress the tertiary data byincreasing sampling increments of the tertiary data on an image spaceand record the compressed tertiary data in the file. Eliminating piecesof the tertiary data to the level in which the visual sensitivity is low(decimation) makes it possible to compress the tertiary data in such arange that the degradation is not visually discernible. This measure isnot limited to use in decimation. For example, the sampling incrementsmay be increased by reducing high spatial frequency components of thetertiary data.

It is preferable that the recording unit divide the tertiary data intomap data indicating shapes of non-correlation regions (i.e., regionswhere substantial dissimilarities exist between the primary data and thesecondary data) and data indicating values of the non-correlationregions. Recording the tertiary data in this form makes it possible toeliminate redundant data in regions other than the non-correlationregions and thereby compress the tertiary data. The image reproducingapparatus side can easily reproduce the secondary data by re-disposingthe data indicating values based on the map data.

It is preferable that the recording unit record pieces of the tertiarydata at non-coincidence positions (i.e., positions of an image where thesecondary data cannot be calculated directly from the primary data) inthe file. For example, the primary data and the secondary datacorrespond to each other approximately one to one at positions havingpixel values for which the first and second gradation conversioncharacteristics coincide with each other. At positions where thecorrelation between the primary data and the secondary data is verystrong, secondary data can be calculated to some extent from the primarydata without using the tertiary data. Therefore, with this measure, thedata amount of the tertiary data can be reduced efficiently by recordingonly pieces of the tertiary data at the non-coincidence positions. Animage reproducing apparatus (described later) discriminates thenon-coincidence positions according to the primary data as reproduced,and re-disposes the recorded tertiary data on the image space. It istherefore preferable that the image recording apparatus discriminatenon-coincidence positions in a manner that the image reproducingapparatus can find the same non-coincidence positions.

It is preferable that the recording unit compress the tertiary data byrun-length coding, entropy coding, and/or predictive coding and recordthe compressed tertiary data in the file. Usually, tertiary data iscalculated according to the primary data and the secondary data of thesame image data. Therefore, it is highly probable that the same dataappears consecutively in the tertiary data. The data size of suchtertiary data can be reduced by performing run-length coding. It ishighly probable that invalid data or the same data appears at a highfrequency in the tertiary data. The data size of such tertiary data canbe reduced by performing entropy coding. Since tertiary data iscalculated from image data having strong spatial correlation from thestart, it is highly probable that the tertiary data also becomes a dataarray having strong spatial correlation. The data size of such tertiarydata can be reduced by performing predictive coding. Performing a propercombination of predictive coding, run-length coding, and entropy codingmakes it possible to compress the tertiary data into data having an evensmaller data size.

It is preferable that the second converting unit change the secondgradation conversion characteristic in accordance with a feature of theimage data.

In general, image data that are produced by imaging exhibit one of thefollowing various features depending on the object, the imagingconditions, and the illumination conditions:

-   -   Including many high-luminance-side gradation components.    -   Including many low-luminance-side gradation components.    -   Including many intermediate-luminance gradation components.    -   Including gradation components in a wide luminance range from        the low-luminance side to the high-luminance side.

The above configuration makes it possible to judge features of the imagedata such as size or deviation of a input signal range, and change thesecond gradation conversion characteristic in accordance with thefeature. This makes it possible to generate secondary data that reflectsthe feature of the image data faithfully. To faithfully reproduce suchsecondary data afterwards, it is preferable that the primary data andthe tertiary data be recorded together.

It is preferable that an image processing program for realizing, on acomputer, the functions of the first converting unit, the secondconverting unit, the correlation calculating unit, and the recordingunit be generated and recorded on a recording medium.

It is preferable that the functions of the first converting unit, thesecond converting unit, the correlation calculating unit, and therecording unit be converted into steps and that the steps be executedsequentially as an image recording method.

On the other hand, the invention provides an image reproducing apparatusfor reproducing a file generated by the above image recording apparatusreading unit for reading primary data and tertiary data from a filegenerated by the above-described image recording apparatus; andsecondary data calculating unit for reproducing secondary data based onthe primary data and the tertiary data. The tertiary data that is readout in this manner includes data that determines correlation between theprimary data and the secondary data. Secondary data (not necessarily thesecondary data itself but may be data that is close to the secondarydata at the time of recording and that has a wide gradation reproductionrange and a large number of signal levels) is reproduced based on thistertiary data and the primary data.

It is preferable that first the reading unit read the primary data, andthe tertiary data on non-coincidence positions, and that the secondarydata calculating unit discriminate the non-coincidence positionsaccording to pixel values of the primary data. For example, thenon-coincidence positions may be discriminated by judging whether thepixel value of the primary data belongs to a non-coincidence portion ofthe first and second conversion characteristics. The reading unitdisposes the tertiary data at the non-coincidence positions and performpositioning between the primary data and the tertiary data. Thesecondary data calculating unit reproduces the secondary data based onthe primary data and the tertiary data that corresponds to the primarydata in pixel positions.

It is preferable that the secondary data calculating unit level-compress(knee-compress) the secondary data to be data which has a range that isgradation-reproducible by an external apparatus, and output thelevel-compressed data. One use of such secondary data is data processingfor printing and designing. For such data processing purposes, it ispreferable that the reproduced secondary data be output as it is inM-bit-gradation form. On the other hand, there is another use in whichusers can enjoy a wide gradation reproduction range and affluentgradation variations with an external apparatus (e.g., a displayapparatus or a printing apparatus). However, such external apparatusesdo not give standard support to such M-bit-gradation. In view of this,the image reproducing apparatus outputs the secondary data afterlevel-compressing it so that the data has a luminance rangegradation-reproducible by an external apparatus. This level compressionallows users to enjoy high-quality features of the secondary data easilywith the external apparatus.

It is preferable that an image processing program for realizing, on acomputer, the functions of the reading unit and the secondary datacalculating unit be generated and recorded on a recording medium.

It is preferable that the functions of the reading unit and thesecondary data calculating unit be converted into steps and that thesteps be executed sequentially as an image reproducing method.

BRIEF DESCRIPTION OF THE DRAWINGS

The nature, principle, and utility of the invention will become moreapparent from the following detailed description when read inconjunction with the accompanying drawings in which like units aredesignated by identical reference numbers, in which:

FIG. 1 is a block diagram showing the configuration of a digital stillcamera 11;

FIG. 2 is a flowchart showing an image recording process according to afirst embodiment of the present invention;

FIG. 3 is a flowchart showing an image reproducing process according tothe first embodiment;

FIG. 4 is a graph showing gradation conversion characteristics used inthe first embodiment;

FIG. 5 is a flowchart showing an image recording process according to asecond embodiment of the invention;

FIG. 6 is a flowchart showing an image reproducing process according tothe second embodiment;

FIG. 7 is a graph showing gradation conversion characteristics used atthe time of recording in the second embodiment; and

FIG. 8 is a graph showing gradation conversion characteristics used atthe time of reproduction in the second embodiment.

DESCRIPTION OF THE PREFERRED EMBODIMENTS

Preferred embodiments of the present invention will be hereinafterdescribed with reference to the accompanying drawings.

Embodiment 1

A first embodiment is directed to a digital still camera.

FIG. 1 is a block diagram showing the configuration of a digital stillcamera 11 according to this embodiment.

As shown in FIG. 1, an imaging lens 12 is mounted on the digital stillcamera 11. The imaging surface of an imaging device 13 is disposed inthe image space of the imaging lens 12. Image data produced by theimaging device 13 are supplied to a buffer memory 16 via a signalprocessing unit 14 and an A/D conversion unit 15 and stored temporarilyin the buffer memory 16. An input/output terminal of the buffer memory16 is connected to a data bus 17. A CPU 18, a frame memory 19, a memorycard 20, an image output interface 21, etc. are also connected to thedata bus 17. An output terminal of the frame memory 19 is connected to amonitor 22.

1. Image Recording Process

FIG. 2 is a flowchart showing an image recording process according tothe first embodiment.

The image recording process according to the first embodiment will bedescribed below in order of step numbers shown in FIG. 2.

Step S1: An image signal produced by the imaging device 13 is suppliedto the A/D conversion unit 15 via the signal processing unit 14.

The A/D conversion unit 15 converts the image signal into14-bit-gradation data by linearly quantizing the image signal in adynamic range of 0-400% white. The A/D conversion unit 15 stores the14-bit-gradation data in the buffer memory 16 (temporary storage).

Step S2: The CPU 18 performs gradation conversion of γ1 (see FIG. 4) onthe 14-bit-gradation data and obtains 8-bit-gradation data. The CPU 18stores the 8-bit-gradation data in the buffer memory 16 (temporarystorage).

Step S3: The CPU 18 judges whether the luminance difference between“background luminance in an image space peripheral portion” and “mainobject luminance at the image space center” of the 14-bit-gradation datais larger than a threshold value. If the luminance difference is greaterthan or equal to the threshold value, the CPU 18 judges thathigh-luminance-side gradation components exist and hence importanceshould be given to high-luminance-side gradation expression and advancesthe process to step S4. On the other hand, if the luminance differenceis smaller than the threshold value, the CPU 18 judges that the dynamicrange is not wide and importance should be given to low-luminance-side,subtle gradation expression and advances the process to step S5.

Step S4: The CPU 18 performs gradation conversion of γ2 (see FIG. 4;having a characteristic in which importance is given tohigh-luminance-side gradation expression) on the 14-bit-gradation dataand obtains 12-bit-gradation data. The CPU 18 stores the12-bit-gradation data in the buffer memory 16 (temporary storage). Then,the CPU 18 advances the process to step S6.

Step S5: The CPU 18 performs gradation conversion of γ3 (see FIG. 4;having a characteristic in which importance is given tolow-luminance-side gradation expression) on the 14-bit-gradation dataand obtains 12-bit-gradation data. The CPU 18 stores the12-bit-gradation data in the buffer memory 16 (temporary storage). Then,the CPU 18 advances the process to step S6.

Step S6: The CPU 18 calculates differences between the 12-bit-gradationdata and the 8-bit-gradation data and employs the calculated differencesas difference data. The difference data thus calculated is stored in thebuffer memory 16 (temporary storage). (The 8-bit-gradation data, the12-bit-gradation data, and the different data correspond to primarydata, secondary data, and tertiary data, respectively.)

When 12-bit-gradation data is generated by using the gradationconversion characteristic γ3, an offset of 2 bits occurs between the12-bit-gradation data and the 8-bit-gradation data. In this case,difference data is calculated after eliminating the offset between thetwo kinds of gradation data by multiplying the 8-bit-gradation data by 4(2 bit shift left).

Step S7: The CPU 18 determines image regions having extremely highluminance according to the 8-bit-gradation data. Image regions havingextremely high luminance need not be reproduced finely because thevisual sensitivity is low for those regions. Therefore, in the imageregions for which the visual sensitivity is low, the CPU 18 decimatesthe samples of the difference data into about ½ or ¼. Where irreversiblecompression is performed on the 8-bit-gradation data, to make a resultof the image region judgment consistent with an image region judgmentresult that will be obtained at the time of reproduction, it ispreferable that the CPU 18 perform the image region judgment accordingto temporary, expanded 8-bit-gradation data.

Step S8: The CPU 18 compresses the difference data by performingpredictive coding (e.g., DPCM). Then, the CPU 18 further compresses thedifference data by performing run-length coding. Then, the CPU 18 stillfurther compresses the difference data by performing entropy coding.

Step S9: The CPU 18 combines the data into a single file in thefollowing manner and records the file in the memory card 20.

Compressed data of 8-bit-gradation data . . . An image storage segmentof a general-purpose image file (e.g., a JPEG file)

Compressed data of difference data . . . An application segment of thegeneral-purpose image file

γ information (i.e., information indicating the kind of the gradationconversion characteristic that was used for the conversion into the12-bit-gradation data)

The recording process of the digital still camera 11 completes uponexecution of step S9.

2. Image Reproducing Process

FIG. 3 is a flowchart showing an image reproducing process according tothe first embodiment.

The image reproducing process according to the first embodiment will bedescribed below in order of step numbers shown in FIG. 3.

Step S11: The CPU 18 reproduces 8-bit-gradation data from an image filethat is recorded in the memory card 20.

Step S12: The CPU 18 judges whether difference data exists in the imagefile recorded in the memory card 20. If difference data exists in theimage file, the CPU 18 advances the process to step S13. On the otherhand, if difference data does not exist in the image file, the CPU 18judges that the image file is a conventional one and finishes thereproducing process.

Step S13: The CPU 18 extracts the difference data and γ information fromthe image file recorded in the memory card 20. Further, the CPU 18sequentially performs, on the difference data, expanding operationscorresponding to entropy coding, run-length coding, and predictivecoding in this order.

Step S14: According to the 8-bit-gradation data, the CPU 18 judges imageregions for which the visual sensitivity is low. In those image regions,the CPU 18 infers, according to surrounding difference data etc.,difference data that was eliminated at the time of recording.

Step S15: The CPU 18 restores 12-bit-gradation data by adding thedifference data to the 8-bit-gradation data.

If it is judged according to the γ information that the gradationconversion characteristic γ3 was used at the time of recording, the CPU18 restores 12-bit-gradation data by adding the difference data to the8-bit-gradation data as multiplied by 4 (2 bit shift left).

Step S16: The CPU 18 outputs the thus-generated 12-bit-gradation datatogether with the γ information etc. to the external system via theinterface 21. Further, the CPU 18 converts the 12-bit-gradation datainto 8-bit-gradation data by performing simplified gradation conversion(e.g., one having a characteristic γ4′ shown in FIG. 8) for monitordisplay or printing in an external apparatus on the 12-bit-gradationdata and outputs the resulting 8-bit-gradation data.

The reproducing process of the digital still camera 11 completes uponexecution of step S16.

3. Advantages Etc. of First Embodiment

In the first embodiment, according to the above-described process,12-bit-gradation data is not recorded as it is but recorded as8-bit-gradation data and difference data. Therefore, the amount ofrecording data can be made smaller properly and easily than in a casewhere 12-bit-gradation data is compressed and recorded separately.

In the first embodiment, two gradation conversion characteristics (γ1and γ2 or γ1 and γ3 in FIG. 4) coincide with each other in the middleportion of the input signal range. Therefore, 8-bit-gradation data and12-bit-gradation data correspond to each other approximately one to onein the main input signal range. The compression efficiency of differencedata can be increased more by making the correlation between8-bit-gradation data and 12-bit-gradation data stronger in this manner.

In the first embodiment, in image regions (high-luminance regions orlow-luminance regions) for which the visual sensitivity is low,difference data is recorded after being decimated. This makes itpossible to efficiently compress difference data in such a range thatthe decimation is not visually discernible.

In the first embodiment, difference data can be compressed efficientlyby performing predictive coding, run-length coding, and entropy codingon it.

In the first embodiment, since the second gradation conversioncharacteristic is changed in such a manner as to be adapted to a featureof image data, 12-bit-gradation data that is more affluent in gradationcan be generated.

In the first embodiment, 12-bit-gradation data that is affluent ingradation can be reproduced when necessary based on recorded8-bit-gradation data and difference data.

Further, in the first embodiment, 12-bit-gradation data that has beenreproduced in the above manner is gradation-converted in a simplifiedmanner and resulting gradation data is output. Therefore, a user caneasily enjoy use of 12-bit-gradation data that is affluent in gradationwith an external apparatus.

Next, another embodiment will be described.

Embodiment 2

A second embodiment is directed to a digital still camera.

The configuration of the digital still camera according to the secondembodiment is the same as that of the digital still camera according tothe first embodiment (see FIG. 1). Therefore, the reference numerals ofthe respective components shown in FIG. 1 will also be used in thefollowing description as they are and the configuration of the digitalstill camera will not be described in the second embodiment.

1. Image Recording Process

FIG. 5 is a flowchart showing an image recording process according tothe second embodiment.

The image recording process according to the second embodiment will bedescribed below in order of step numbers shown in FIG. 5.

Step S21: The A/D conversion unit 15 converts an image signal into14-bit-gradation data by linearly quantizing the image signal in adynamic range of 0%-400% white.

Step S22: The CPU 18 converts the 14-bit-gradation data into8-bit-gradation data by performing gradation conversion of γ4 (see FIG.7) on it. In this case, it is preferable that the gradation conversionassure gradation reproduction up to about 140% white.

Step S23: The CPU 18 converts the 14-bit-gradation data into12-bit-gradation data by performing gradation conversion of γ5 (see FIG.7) on it. In this case, it is preferable that the gradation conversionassure gradation reproduction up to 200% white (if possible, about 400%white).

Step S24: The CPU 18 JPEG-compresses the 8-bit-gradation data and storescompressed data in an “image storage segment to be preferentiallyreferred to”, which is in an image file.

Step S25: The CPU 18 JPEG-expands the compressed 8-bit-gradation dataand obtains 8-bit-gradation expanded data (hereinafter referred to as“8-bit expanded data”).

Step S26: The CPU 18 sequentially refers to the 8-bit expanded data on apixel-by-pixel basis and judges whether the pixel being referred to islocated at a non-coincidence position. The term “non-coincidenceposition” means a position where the 8-bit part of the 12-bit-gradationdata does not coincide with the 8-bit expanded data. At such anon-coincidence position, difference data is necessary for reproductionof a 12-bit gradation. Conversely, at a coincidence position, differencedata is not necessary because 12-bit-gradation data can be reproducedfrom the 8-bit expanded data.

Specifically, if the 8-bit expanded data of the pixel being referred toexceeds a predetermined threshold value (indicated by character A inFIG. 7), the CPU 18 judges that the pixel is located at anon-coincidence position because difference data is necessary forreproduction of 12-bit-gradation data. On the other hand, if the 8-bitexpanded data of the pixel being referred to is smaller than or equal tothe threshold value A, the CPU 18 judges that reproducing12-bit-gradation data from the 8-bit expanded data is sufficientpractically and hence judges that the pixel being referred to is notlocated at a non-coincidence position.

If the pixel being referred to is located at a non-coincidence position,the CPU 18 advances the process to step S27. On the other hand, if thepixel being referred to is not located at a non-coincidence position,the CPU 18 advances the process to step S30.

Step S27: For the pixel being referred to, the CPU 18 calculates adifference value between the 12-bit-gradation data and the 8-bitexpanded data.

Step S28: The CPU 18 nonlinearly quantizes the difference valueaccording to a characteristic for compressing high-luminance-side (orlow-luminance-side) gradations and thereby decreases the number ofquantization bits.

Step S29: The CPU 18 further DPCM-compresses the difference value whosenumber of quantization bits has been decreased.

Step S30: The CPU 18 judges whether all pixels have been referred to. Ifall pixel have been referred to, the CPU 18 advances the process to stepS31. On the other hand, if not all pixels have been referred to yet, theCPU 18 returns the process to step S26 to execute steps S26-S30 again.

Step S31: The CPU 18 stores the compressed data of the difference data(i.e., an array of difference values that have been calculated in theabove manner) in an application segment in the image file.

Step S32: The CPU 18 transfers the image file thus generated to thememory card 20 and stores the image file therein.

The recording process according to the second embodiment completes uponexecution of step S32.

2. Image Reproducing Process

FIG. 6 is a flowchart showing an image reproducing process according tothe second embodiment.

The image reproducing process according to the second embodiment will bedescribed below in order of step numbers shown in FIG. 6.

Step S41: The CPU 18 extracts JPEG-compressed data from the imagestorage segment of an image file stored in the memory card 20 andexpands the JPEG-compressed data into 8-bit expanded data.

Step S42: The CPU 18 sequentially refers to the 8-bit expanded data on apixel-by-pixel basis, and judges whether the pixel being referred to islocated at a non-coincidence position.

Specifically, if the 8-bit expanded data of the pixel being referred tois smaller than or equal to the threshold value A, the CPU 18 judgesthat the pixel being referred to is not located at a non-coincidenceposition and advances the process to step S43. On the other hand, if the8-bit expanded data of the pixel being referred to exceeds the thresholdvalue A, the CPU 18 judges that the pixel being referred to is locatedat a non-coincidence position and advances the process to step S44.

Step S43: The CPU 18 calculates 12-bit-gradation data from the 8-bitexpanded data of the pixel being referred to (with the characteristicshown in FIG. 7, the 8-bit expanded data may be employed as it is as12-bit-gradation data). Then, the CPU 18 advances the process to stepS47.

Step S44: The CPU 18 extracts a difference value from difference data inthe application segment of the image file.

Step S45: The CPU 18 restores an original difference value from theDPCM-compressed difference value. Further, the CPU 18 expands ahigh-luminance-side (or low-luminance-side) gradation of the differencevalue and thereby restores the corrected value by inverse-quantizationof the difference value.

Step S46: The CPU 18 adds the restored difference value to the 8-bitexpanded data and thereby reproduces 12-bit-gradation data of the pixelbeing referred to.

Step S47: The CPU 18 judges whether all pixels have been referred to. Ifall pixels have been referred to, the CPU 18 advances the process to thenext step S48. On the other hand, if not all pixels have been referredto, the CPU 18 returns the process to step S42 to execute steps S42-S47again.

Step S48: The CPU 18 converts the 12-bit-gradation data thus calculatedinto 8-bit-gradation data by performing simplified gradation conversion(e.g., by sequentially performing conversion having a characteristicthat is reverse to a characteristic γ5 shown in FIG. 8 and conversionhaving a characteristic γ4′ shown in FIG. 8) for monitor display orprinting in an external apparatus on the 12-bit-gradation data, andoutputs the resulting 8-bit-gradation data.

The reproducing process of the digital still camera 11 completes uponexecution of step S48.

3. Advantages Etc. of Second Embodiment

Also in the second embodiment, according to the above-described process,12-bit-gradation data is not recorded as it is but recorded as8-bit-gradation data and difference data. Therefore, the amount ofrecording data can be made smaller properly and easily than in a casewhere 12-bit-gradation data is compressed and recorded separately.

In the second embodiment, two gradation conversion characteristics (γ4and γ5 in FIG. 7) coincide with each other up to the gradation value A.Therefore, the correlation between 8-bit-gradation data and12-bit-gradation data becomes stronger and hence the compressionefficiency of difference data can be increased more.

In the second embodiment, in a input signal range where the visualsensitivity is low, difference data is recorded after beinglevel-compressed (nonlinearly quantized). This makes it possible torationally decrease the number of quantization bits of the differencedata in such a range that the compression is not visually discernible.

In the second embodiment, 8-bit-gradation data is recorded in an “imagestorage segment to be preferentially referred to”, which is in an imagefile. And difference data is recorded in the application segment of theimage file. This recording method makes it possible to reliably maintaincompatibility with conventional image files. Therefore, 8-bit-gradationdata in an image file according to the invention can be processed,displayed, or printed by using a general-purpose image browsing programor a general-purpose external apparatus as it is.

In the second embodiment, at the time of image recording, differencedata is generated based on 8-bit expanded data and 12-bit-gradationdata. Therefore, at the time of image reproduction, 12-bit-gradationdata can be reproduced more correctly based on the 8-bit expanded dataand the difference data.

In the second embodiment, at the time of reproduction, tertiary data andprimary data are correlated with each other by performing thenon-coincidence position judgment. With this operation, the tertiarydata need not include map data and an advantage is provided that thedata amount of the tertiary data can be reduced efficiently.

Tertiary data may be recorded so as to be divided into map data ofnon-correlation regions and value data. In this case, compressed data ofa binary bit map indicating whether each pixel belongs to anon-correlation region may be recorded as the map data. Alternatively,data (e.g., chain coding data) indicating outline shapes ofnon-correlation regions or like data may be recorded as the map data.

Further, in the second embodiment, the data amount of difference datamay further be reduced by increasing the difference data samplingincrement. In addition, the reproduction performance of gradations ofsecondary data may further be increased by automatically changing thegradation conversion characteristic γ5 shown in FIG. 7 in accordancewith a feature of image data.

Supplements to Embodiments

For convenience of description, the above embodiments are examples inwhich the invention is applied to a digital still camera. However, theinvention is not limited to such a case and can be used in recording orreproducing image data having a wide dynamic range. For example, animage processing program for execution of any of the above processes(e.g., the processes described above with reference to FIGS. 2, 3, 5,and 6) may be written in a predetermined programming language andrecorded on a machine-readable recording medium.

The manner of practicing part of the invention relating to such an imageprocessing program is not limited to the above. For example, bydelivering data of such an image processing program via a communicationline, a “recording medium such as a memory or a hard disk on which theimage processing program is recorded” can be produced in a computer at adelivering destination. Further, it is possible to mediate a transfer ofsuch an image processing program or manufacture of a recording medium byinforming a party concerned about the location of the program.

The same operations and advantages as obtained by the above embodimentscan be obtained on a computer by using such a recording medium.

It is possible to practice an image recording method and an imagereproducing method according to the procedures of the above processes(e.g., the processes described above with reference to FIGS. 2, 3, 5,and 6). Also in this case, the same operations and advantages asobtained by the above embodiments can be obtained.

Although the above embodiments are mainly directed to gradationprocessing, the invention is not limited to such a case. For example, inthe case of handling color image data, the above-described processingmay be performed for the gradation of each of stimulus values of RGB,YCbCr, etc.

For example, tertiary data may be calculated for only a component havinghigh luminous efficiency (e.g., Y or G) among stimulus values of colorimage data. This makes it possible to further reduce the data amount oftertiary data. In this case, at the time of reproduction, secondary datamay be reproduced by using primary data and tertiary data that is formedby a component having high luminous efficiency. This reproducing processcannot completely (100%) restore components (CbCr, RB, or the like towhich the visual sensitivity is low) that are not included in thetertiary data. However, it is possible to reproduce secondary data insuch a range that it is suitable for practical use in terms of visualrecognition.

Although the above embodiments use difference data as tertiary data, theinvention is not limited to such a case. In general, any data thatdetermines correlation between primary data and secondary data can beused as tertiary data. For example, a ratio between primary data andsecondary data may be calculated as dissimilarity between them and usedas tertiary data.

In the first embodiment, tertiary data is compressed in as high a degreeas possible by performing multiple coding, that is, performingpredictive coding, run-length coding, and entropy coding. However, theinvention is not limited to such a case. For example, tertiary data maybe compressed by performing one or two of predictive coding, run-lengthcoding, and entropy coding. Naturally, tertiary data may be recordedwithout being compressed.

In the above embodiments, 8-bit-gradation data is employed as primarydata and 12-bit-gradation data is employed as secondary data. It goeswithout saying that the numbers of gradations are unlimited to those of8 bits and 12 bits.

Although the above embodiments are directed to the case of handling astill image, the invention is not limited to such a case. For example,the invention may be applied to a case of handling a moving image. Inthis case, for example, tertiary data may be compressed in the time-axisdirection.

Although in the above embodiments a generated image file is stored in amemory card, the recording unit of the invention is not limited to beinga unit for storing a file for a long period. For example, the recordingunit of the invention may be a unit for storing a file temporarily in asystem memory, an image memory, a buffer, or the like.

The invention is not limited to the above embodiments and variousmodifications may be made without departing from the spirit and scope ofthe invention. Any improvement may be made in part or all of thecomponents.

1. A computer-readable recording medium on which an image processing program is recorded, for reproducing a file generated by an image recording apparatus, the image recording apparatus having: a first converting unit that receives image data and converts the image data into primary data having an N-bit range according to a first gradation conversion characteristic; a second converting unit that receives the same image data received by the first converting unit and converts the same image data into secondary data having an M-bit range according to a second gradation conversion characteristic that is lower in a degree of level compression than the first gradation conversion characteristic or that causes no level compression, where M is greater than N; a dissimilarity calculating unit that receives the primary data and the secondary data and calculates dissimilarity between the primary data and the secondary data according to each position of each pixel and uses data regarding the calculated dissimilarity to output tertiary data; and a recording unit for recording the primary data and the tertiary data in the file, the image processing program comprising instructions to cause a computer to perform the steps of: reading the primary data and the tertiary data from the file; and reproducing the secondary data based on the primary data and the tertiary data read from the file.
 2. A computer-readable recording medium on which an image processing program is recorded, for reproducing a file generated by an image recording apparatus, the image recording apparatus having: a first converting unit that receives image data and converts the image data into primary data having an N-bit range according to a first gradation conversion characteristic; a second converting unit that receives the same image data received by the first converting unit and converts the same image data into secondary data having an M-bit range according to a second gradation conversion characteristic that is lower in a degree of level compression than the first gradation conversion characteristic or that causes no level compression, where M is greater than N; a dissimilarity calculating unit that receives the primary data and the secondary data and calculates dissimilarity between the primary data and the secondary data according to each position of each pixel and uses data regarding the calculated dissimilarity to output tertiary data; and a recording unit for discriminating a non-coincidence position that is a position in an image where the secondary data cannot be calculated directly from the primary data and for recording the primary data and the tertiary data at the non-coincidence position in the file, the image processing program comprising instructions to cause a computer to perform the steps of: reading the primary data and the tertiary data from the file; and reproducing the secondary data based on the primary data and the tertiary data read from the file, wherein said reproducing discriminates the non-coincidence positions according to pixel values of the primary data, disposes the tertiary data at the non-coincidence positions and performs positioning between the primary data and the tertiary data, and reproduces the secondary data based on the primary data and the tertiary data that corresponds to the primary data in pixel position.
 3. An image reproducing method for reproducing a file generated by an image recording apparatus, the image recording apparatus having: a first converting unit that receives image data and converts the image data into primary data having an N-bit range according to a first gradation conversion characteristic; a second converting unit that receives the same image data received by the first converting unit and converts the same image data into secondary data having an M-bit range according to a second gradation conversion characteristic that is lower in a degree of level compression than the first gradation conversion characteristic or that causes no level compression, where M is greater than N; a dissimilarity calculating unit that receives the primary data and the secondary data and calculates dissimilarity between the primary data and the secondary data according to each position of each pixel and uses data regarding the calculated dissimilarity to output tertiary data; and a recording unit for recording the primary data and the tertiary data in the file, the image reproducing method comprising the steps of: reading the primary data and the tertiary data from the file; and reproducing the secondary data based on the primary data and the tertiary data read from the file.
 4. An image reproducing method for reproducing a file generated by an image recording apparatus, the image recording apparatus having: a first converting unit that receives image data and converts the image data into primary data having an N-bit range according to a first gradation conversion characteristic; a second converting unit that receives the same image data received by the first converting unit and converts the same image data into secondary data having an M-bit range according to a second gradation conversion characteristic that is lower in a degree of level compression than the first gradation conversion characteristic or that causes no level compression, where M is greater than N; a dissimilarity calculating unit that receives the primary data and the secondary data and calculates dissimilarity between the primary data and the secondary data according to each position of each pixel and uses data regarding the calculated dissimilarity to output tertiary data; and a recording unit for discriminating a non-coincidence position that is a position in an image where the secondary data cannot be calculated directly from the primary data and for recording the primary data and the tertiary data at the non-coincidence position in the file, the image reproducing method comprising the steps of: reading the primary data and the tertiary data from the file; and reproducing the secondary data based on the primary data and the tertiary data read from the file, wherein said reproducing discriminates the non-coincidence positions according to pixel values of the primary data, disposes the tertiary data at the non-coincidence positions and performs positioning between the primary data and the tertiary data, and reproduces the secondary data based on the primary data and the tertiary data that corresponds to the primary data in pixel position. 